//
//  TagListTableViewCell.m
//  UniversalApp
//
//  Created by 志刚杨 on 2018/8/14.
//  Copyright © 2018年 voidcat. All rights reserved.
//

#import "TagListTableViewCell.h"

@implementation TagListTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.selectionStyle = UITableViewCellSelectionStyleNone;

//    [self.tagList addTag:ASLocalizedString(@"测试1")withConfig:tagConfig];
//    [self.tagList addTag:ASLocalizedString(@"测试2")withConfig:tagConfig];
}

-(void)setModel:(EvaluateUserList *)model
{
    _model = model;
    [_icon sd_setImageWithURL:SafeStr(model.avatar)];
    _tagName.text = model.user_nickname;
    TTGTextTagConfig *tagConfig = [[TTGTextTagConfig alloc] init];
    tagConfig.tagTextColor = KWhiteColor;
    tagConfig.tagSelectedBackgroundColor = MainColor;
    tagConfig.tagBackgroundColor = MainColor;
    tagConfig.tagShadowRadius = 0;
    tagConfig.tagBorderWidth = 0;
    tagConfig.tagShadowColor = KClearColor;
    tagConfig.tagCornerRadius = 11;
    tagConfig.tagTextFont = DEFAULT_FONT(12);
    tagConfig.tagExtraSpace = CGSizeMake(10, 10);
    //循环添加tag
    for (int i=0; i<model.label_list.count; i++) {
        [self.tagList addTag:SafeStr(model.label_list[i]) withConfig:tagConfig];
    }
    
}

-(void)layoutIfNeeded
{
    [super layoutIfNeeded];
    ViewRadius(self.icon, self.icon.height/2);
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
